var divs=new Array();

function inpDuqu() {
	var inp = document.getElementById("inp");
	var div1 = document.createElement("div");
	div1.innerHTML = inp.value;
	var fdiv = document.getElementById("disp");
	fdiv.appendChild(div1);
}
var ldiv;

function btnLr() {
	var inp = document.getElementById("inp");
	var tem=ldiv;
	ldiv  = document.createElement("div");
	ldiv.innerHTML = inp.value;
	var fdiv = document.getElementById("disp");
	fdiv.insertBefore(ldiv,tem);
	//fdiv.appendChild(div1);
	divs.unshift(ldiv)
}
var rdiv;
function btnRr() {
	var inp = document.getElementById("inp");
	rdiv = document.createElement("div");
	rdiv.innerHTML = inp.value;
	var fdiv = document.getElementById("disp");
	
	fdiv.appendChild(rdiv);
	divs.push(rdiv);
}

function btnLc() {
	var dd=divs.shift();
	var fdiv = document.getElementById("disp");
	fdiv.removeChild(dd)
}

function btnRc() {
	var dd=divs.pop();
	var fdiv = document.getElementById("disp");
	fdiv.removeChild(dd)
}